<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Realm - Login</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="author" content="Bluth Company">
    <link rel="shortcut icon" href="../../assets/ico/favicon.html">
    <link href="../../assets/css/bootstrap.css" rel="stylesheet">
    <link href="../../assets/css/theme.css" rel="stylesheet">
    <link href="../../assets/css/font-awesome.min.css" rel="stylesheet">
    <link href="../../assets/css/alertify.css" rel="stylesheet">
    <link rel="Favicon Icon" href="favicon.ico">
    <link href="http://fonts.useso.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
    <style>
      .imggg{
        width: 100vw;
        height: 80vw;
        position: fixed;
        left: 0;
        top: 0;
        opacity: .6;
        z-index: -1000;
      }
    </style>
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
  </head>
  <body>
    
    <div id="wrap" style="margin-top: 10%">
    <div class="container-fluid">
      <div class="row-fluid">
        <div class="span12">
          <div class="row-fluid">
				<div class="widget container-narrow">
					<div class="widget-header" style="align-items: center;justify-content: center;justify-items: center;
          display: flex;">
						<!-- <i class="icon-user"></i> -->
            <h5 style="font-weight: bold;">登录账户</h5>
					</div>  
					<div class="widget-body clearfix" style="padding:25px;">

							<div class="control-group">
								<div class="controls">
									<input class="btn-block" type="text" id="inputEmail" name="number" placeholder="用户名">
								</div>
							</div>
							<div class="control-group">
								<div class="controls">
									<input class="btn-block" type="password" id="inputPassword" name="pw" placeholder="密码">
								</div>
							</div>

              

							<div class="control-group">
								<div class="controls clearfix">
									<label style="width:auto" class="checkbox pull-left">
										<input type="checkbox"> 记住密码
									</label>
									<a style="padding: 5px 0px 0px 5px;" href="reg.html" class="pull-right">注册账号</a>
								</div>
							</div>					
              <button type="submit" class="btn submit pull-right">登录</button>
              
					</div>  
				</div>  
      			
        	</div><!--/row-fluid-->
        </div><!--/span10-->
      </div><!--/row-fluid-->
    </div><!--/.fluid-container-->
    </div><!-- wrap ends-->

    <script src="../../assets/js/jquery.min.js"></script>
    <script src="../../assets/js/jquery-ui.min.js"></script>
    <script src="../../assets/js/raphael-min.js"></script>
    <script src="../../assets/js/bootstrap.js"></script>
    <script src='../../assets/js/sparkline.js'></script>
    <script src='../../assets/js/morris.min.js'></script>
    <script src="../../assets/js/jquery.dataTables.min.js"></script>   
    <script src="../../assets/js/jquery.masonry.min.js"></script>   
    <script src="../../assets/js/jquery.imagesloaded.min.js"></script>   
    <script src="../../assets/js/jquery.facybox.js"></script>   
    <script src="../../assets/js/jquery.elfinder.min.html"></script> 
    <script src="../../assets/js/jquery.alertify.min.js"></script> 
    <script src="../../assets/js/realm.js"></script>
    <script>
        $('.submit').click(function () { 
        var uphone = $('#inputEmail').val();
        var pass = $('#inputPassword').val();
        console.log('object', uphone,pass);
        $.ajax({
            type: 'get',
            // dataType: 'jsonp',
            // jsonp: 'callback',
            // headers: 'Access-Control-Allow-Origin',
            url: 'http://localhost/dancer/public/json/user/login',
            data: {
                uphone: uphone,
                pass: pass
            },
            async: false,
            success: function (data) { 
                console.log('data', typeof(data));
                console.log('data', data);
                var json = JSON.parse(data);
                // $('#box').append(data);
                if(json!=null){
                    alert('login successful');
                    location.href = '../../index.html';
                }else{
                    alert('phoneNumber or password incorrect');
                }
             }
        })

    })
    </script>
  </body>
</html>